import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('../views/index.vue'),
    children:[
      {
        path: '',
        redirect: 'mains'
    },
      {
      path: '/mains',
      name: 'mains',
      component: () => import( '../views/mains.vue')
      },
      {
      path: '/allShop',
      name: 'allShop',
      component: () => import('../views/allShop.vue'),
      meta:{
        title:'全部商品'
      }
    },
    {
      path: '/ProductDetails',
      name: 'ProductDetails',
      component: () => import('../views/ProductDetails.vue'),
    },
    {
      path: '/Collection',
      name: 'Collection',
      component: () => import('../views/Collection.vue'),
    },
    {
      path: '/NoCollection',
      name: 'NoCollection',
      component: () => import('../views/NoCollection.vue'),
    },
    {
      path: '/order',
      name: 'order',
      component: () => import('../views/order.vue'),
    
    },
    {
      path: '/NoOrder',
      name: 'NoOrder',
      component: () => import('../views/NoOrder.vue'),
    },
    {
      path: '/shop',
      name: 'shop',
      component: () => import('../views/shop.vue'),
    },
    {
      path: '/NoShop',
      name: 'NoShop',
      component: () => import('../views/NoShop.vue'),
    },
    {
      path: '/address',
      name: 'address',
      component: () => import('../views/address.vue'),
    },
  ]
  }
]

const router = new VueRouter({
  routes
})

export default router
